import React,{useState,useEffect} from 'react'
import {NavLink as Link, withRouter} from "react-router-dom";
import { EnvironmentOutlined,
  UserOutlined,
  UpCircleOutlined,
  DiffOutlined,
  SecurityScanOutlined, } from '@ant-design/icons'
import "./index.css";
function Footer(props) {
    // console.log(111111,props);
    const [flag, setFlag] = useState(true);
    useEffect(()=>{
        if( 
        props.location.pathname == "/" ||
        // props.location.pathname == "/VIP" ||
        props.location.pathname == "/healthy" ||
        props.location.pathname == "/mine" ||
        props.location.pathname == "/country"
        ){
            setFlag(true);  
        }else{
            setFlag(false);
        }
    },[props.location.pathname])
  return (
    <>
    {flag ? (
      <div className="footer">
        <ul>
          <li>
            <Link to="/" exact className="dibuyangshi">
            <DiffOutlined/>
              
              微医
            </Link>
          </li>
          <li>
            <Link to="/country">
            <EnvironmentOutlined />
              全国</Link>
            
          </li>
          <li>
            <Link to="/healthy">
            <SecurityScanOutlined />
              健康</Link>
          </li>
          {/* <li>
            <Link to="/VIP">
            <UpCircleOutlined />
              会员</Link>
          </li> */}
          <li>
            <Link to="/mine">
            <UserOutlined />
              我的</Link>
          </li>
         
        </ul>
      </div>
    ) : null}
  </>
   
  );
}

export default withRouter(Footer)